package com.ChenYaRou.www.dao;

import com.ChenYaRou.www.po.District;

import java.sql.SQLException;
import java.util.List;

/**
 * @author 86183
 */
public interface DistrictDao {
    /**
     * 查找地区集合
     * @param district 仅赋值条件的district
     * @return 地区集合
     * @throws IllegalAccessException
     * @throws SQLException
     * @throws NoSuchFieldException
     * @throws InstantiationException
     */
    List<District> select(District district) throws IllegalAccessException,
            SQLException, NoSuchFieldException, InstantiationException;

    /**
     * 查询单个street
     * @param district
     * @return
     * @throws IllegalAccessException
     * @throws SQLException
     * @throws NoSuchFieldException
     * @throws InstantiationException
     */
     District selectSingle(District district) throws IllegalAccessException, SQLException, NoSuchFieldException, InstantiationException;

    /**
     * update district
     * @param newDistrict district需要更新的值
     * @param  oldDistrict old district
     * @return 成功与否
     * @throws IllegalAccessException
     * @throws SQLException
     */
    int update(District newDistrict,District oldDistrict) throws IllegalAccessException, SQLException;

    /**
     * 插入district
     * @param district 新district
     * @return 更新条数
     * @throws IllegalAccessException
     * @throws SQLException
     */
    int insert(District district) throws IllegalAccessException, SQLException;

}
